﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Xsl;
using Ext.Net;
using System.IO;

namespace Enterprise.Web
{
    public class BusinessPage:System.Web.UI.Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (!Page.IsPostBack)
            {
                this.InitializeControls();
                this.LoadData();
            }
        }


        public virtual void InitializeControls()
        {

        }

        public virtual void LoadData()
        {

        }

        public virtual void Search()
        {

        }

        

        [DirectMethod]
        public virtual void ExecuteGridCommand(string command, int id)
        {
            switch (command)
            {
                case "1":
                    this.AddEvent();
                    break;
                case "2":
                    this.EditEvent(id);
                    break;
                case "3":
                    this.DeleteEvent(id);
                    break;
                case "4":
                    this.DetailEvent(id);
                    break;
                case "5":
                    this.CopyEvent(id);
                    break;

                default:
                    break;
            }    
        }

        public virtual void AddEvent()
        {}

        public virtual void DetailEvent(int id)
        { }

        public virtual void DeleteEvent(int id)
        { }

        public virtual void EditEvent(int id)
        { }

        public virtual void CopyEvent(int id)
        { }

        public void DisplayErrorMessage(string message)
        { }
        public void DisplayErrorMessage(string message, bool displayOnMaster)
        { }
        public void DisplayInfoMessage(string message)
        { }

        public void DisplayInfoMessage(string message, bool displayOnMaster)
        { }
        public void DisplayWarningMessage(string message)
        { }
        public void DisplayWarningMessage(string message, bool displayOnMaster)
        { }

        public void Redirect(string destination)
        {
            base.Response.Redirect(destination);
        }
    }
}
